package cn.psvmc.cxzapi.service.customer;

import cn.psvmc.cxzapi.mapper.goods.TGoodsExampleMapper;
import cn.psvmc.cxzapi.mapper.market.*;
import cn.psvmc.cxzapi.model.common.GoodsEntity;
import cn.psvmc.cxzapi.model.common.MarketEntity;
import cn.psvmc.cxzapi.model.goods.TGoodsExample;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 客户表 服务实现类
 *
 * @Author auto
 * @Date 2024-08-12
 */
@Service
public class TCustomerHomeService {
    @Resource
    private TMarketMapper tMarketMapper;
    @Resource
    private TSortComponentMapper tSortComponentMapper;
    @Resource
    private TBannerMapper tBannerMapper;
    @Resource
    private TBanner2Mapper tBanner2Mapper;
    @Resource
    private TGoodsExampleMapper tGoodsExampleMapper;


    /**
     * @Description 营销首页表列表
     * @Date 2024/8/29 21:55
     * @Author YWX
     * @Param [entity]
     * @Return java.util.List<java.util.Map>
     **/
    public List<Map> listMarket(MarketEntity entity) {
        return tMarketMapper.listAll(entity);
    }

    /**
     * @Description 分类推荐组件实例列表
     * @Date 2024/8/29 21:58
     * @Author YWX
     * @Param [entity]
     * @Return java.util.List<java.util.Map>
     **/
    public List<Map> listComponent(MarketEntity entity){
        return tSortComponentMapper.listAll(entity);
    }

    /**
     * @Description Banner 实例列表
     * @Date 2024/8/29 22:01
     * @Author YWX
     * @Param [entity]
     * @Return java.util.List<java.util.Map>
     **/
    public List<Map> listBanner(MarketEntity entity){
        return tBannerMapper.listAll(entity);
    }

    /**
     * @Description 1+2Banner 实例列表
     * @Date 2024/8/29 22:02
     * @Author YWX
     * @Param [entity]
     * @Return java.util.List<java.util.Map>
     **/
    public List<Map> listBanner2(MarketEntity entity){
        return tBanner2Mapper.listAll(entity);
    }

    /**
     * @Description 商品推荐实例列表
     * @Date 2024/8/29 22:07
     * @Author YWX
     * @Param [entity]
     * @Return java.util.List<java.util.Map>
     **/
    public List<Map> listExample(MarketEntity entity){
        return tGoodsExampleMapper.listAll(entity);
    }

    /**
     * @Description 根据标签查询商品列表
     * @Date 2024/9/1 18:12
     * @Author YWX
     * @Param [iPage, entity]
     * @Return com.baomidou.mybatisplus.core.metadata.IPage<java.util.Map>
     **/
    public IPage<Map> listTagsGoods(Page<TGoodsExample> iPage, GoodsEntity entity) {
        return tGoodsExampleMapper.listGoodsByTag(iPage, entity);
    }

    /**
     * @Description 热门推荐商品列表
     * @Date 2024/10/2 20:21
     * @Author YWX
     * @Param [queryPage, entity]
     * @Return com.baomidou.mybatisplus.core.metadata.IPage<java.util.Map>
     **/
    public IPage<Map> listHotsGoods(Page<TGoodsExample> queryPage, GoodsEntity entity) {
        return tGoodsExampleMapper.listGoodsByHot(queryPage, entity);
    }
}
